<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	



<ui:composition template="/template/templategiris.xhtml">

	<ui:define name="baslik">Marmara Üniversitesi Kütüphane Kulübü</ui:define>

	<ui:define name="ekran">
 
		<p:panel header="Kitap Arama Ekranı">


			<h:form id="box">
				<h:panelGrid columns="2">
					<b>Kitap Adı:</b>
					<p:inputText value="#{kitapArama.kitapBilgileri.kitapAdi}" />
					
				    
				    <b>Tür Ad:</b>
				    <p:selectOneMenu value="#{kitapArama.kitapBilgileri.turId.id}" id="tur">
				       <f:selectItem itemLabel="Tür Seçiniz" itemValue="" /> 
				       <f:selectItems value="#{kitapArama.kitapTurBilgileri}" />
				    </p:selectOneMenu>
				    
				    
				    <b>Dil:</b>
				    <p:selectOneRadio value="#{kitapArama.kitapBilgileri.dil.dilId}" layout="lineDirection" id="dil">
				       <f:selectItems value="#{kitapArama.dilTurleriListesi}"/>
				    </p:selectOneRadio>
				    
				   
					<p:commandButton value="Ara" actionListener="#{kitapArama.arama}"
						update="ara" style="width:80px;text-align:center" />
						
				</h:panelGrid>
				<br />
			</h:form>

			<h:form id="ara">
				<p:dataTable var="kitap" rendered="#{not empty kitapArama.kitapListesi}" value="#{kitapArama.kitapListesi}" 
       paginator="true" selectionMode="single" style="border:1px #66aaff;text-align:center;" rows="10" height="180"  scrollable="true" liveScroll="true" width="600" >

					
					
					<f:facet name="header">Kitap Bilgileri</f:facet>

					<p:column style="width:300px">
						 
						 <f:facet name="header">
                            Kitap Adı		
                         </f:facet>
						 
						 <h:outputText value="#{kitap.kitapAdi}" />
				
					</p:column>



					<p:column style="width:300px">
						<f:facet name="header">
                           Tür Adı
                           </f:facet>
						<h:outputText value="#{kitap.turId.turAd}" />
						
					</p:column>


					<p:column style="width:300px">
						<f:facet name="header">
                            Dil
                           </f:facet>
						<h:outputText value="#{kitap.dil.dilTipi}" />
					</p:column>



					<p:column style="width:300px">
						<f:facet name="header">
                          Sayfa Sayisi
                       </f:facet>
						<h:outputText value="#{kitap.sayfaSayisi}" />
					</p:column>


					<p:column style="width:300px">
						<f:facet name="header">
                          Basim Yılı
                       </f:facet>
						<h:outputText value="#{kitap.basimYil}">
							<f:convertDateTime pattern="dd/MM/yyyy" />
						</h:outputText>
					</p:column>
					
				
             
				
				</p:dataTable>
				
				<c:if  test="#{empty kitapArama.kitapListesi}">
                 
                   <div><h3> Aradığınız Kriterlere Uygun Kayıt Bulunamadı.</h3></div>
                      
                </c:if>
                 
                 
				<br />
				<br />
			</h:form>

		</p:panel>


	</ui:define>

</ui:composition>

</html>
